This is an interactive session to introduce the basic concepts of mathematical modelling of infectious diseases using a game.
We recommend to save your text at the end of each part by printing the file. –>
This is a practical session in which, individually or as part of a group, you will simulate an epidemic using some simple apparatus. The objective of this exercise is to simulate and graphically illustrate the SIR compartmental model.
1.1 Assign a state for each type of marble:
| State variable | Colour of Marble |
|---|---|
| Susceptible (S) | |
| Infected (I) | |
| Recovered (R) |
1.2 Each time step is one week. For the first time step, place 19 susceptible marbles in the cup along with one infectious marble. Pour the marbles in a line on your foam holder. Record your result in the table below for week 1. Check that your total population, P, remains at 20 throughout the experiment.
| Week | S | I | R | P |
|---|---|---|---|---|
| 1 | 19 | |||
| 2 | ||||
| 3 | ||||
| 4 | ||||
| 5 | ||||
| 6 | ||||
| 7 | ||||
| 8 | ||||
| 9 | ||||
| 10 |
1.3 The infectious marble can infect susceptible neighbours so replace any susceptible neighbours with infectious marbles. The infectious period is one week, so keep track of the original infected marble and replace it with a recovered marble. Record the numbers of susceptible, infectious and recovered individuals in the table above for week 2.
1.4 Once the status of the individuals has been updated, place the marbles in the cup. Then pour them out again. Replace all susceptible neighbours of infectious marbles with new infectious marbles (recovered marbles are immune and cannot be infected). Don’t forget to replace the original infected marbles with recovered marbles. Record the numbers of susceptible, infectious and recovered individuals in the table above for week 3.
1.5 Repeat until you reach 10 weeks.
Here is some code to record and plot your results in R. Open RStudio, create a new file and copy and paste the code chunk below into your editor. Then replace the default results with your own.
# Mathematical Modelling for Infectious Diseases
# 2019 Module
###################################################
## INTRODUCTION TO MATHEMATICAL MODELLING PRACTICAL SESSION##
###################################################
# Record and plot simulated epidemics
# create a matrix to store experimental results
result <- matrix(NA,nrow=10,ncol=5)
# weeks
result[,1]<-1:10 # weeks
# replace with your S count for each week
result[,2]<-c(19, 17, 13, 9, 5, 2, 1, 1, 1, 1) # S
# replace with your I count for each week
result[,3]<-c(1, 2, 4, 4, 4, 3, 1, 0, 0, 0) # I
# replace with your R count for each week
result[,4]<-c(0, 1, 3, 7, 11, 15, 18, 19, 19, 19) # R
1.6 Write a line in R to calculate the sum S+I+R for each week and assign this to column 5 of the results matrix.
1.7 Type results[,5] in your console. What do you see and why?
Copy and paste the code chunk below into your editor to plot your results:
# plot your results
plot(result[,1],result[,3],type='p',pch=19,col='red',main = "My simulated epidemic",xlab = "Time in weeks",ylab="I")
1.8 How does your result differ from the default?
1.9 Why would we expect a different result each time?
–>